package com.yang.controller;

import com.yang.domain.Result;
import com.yang.service.UploadService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;

@RestController
public class UploadController {

    @Resource
    private UploadService uploadService;

    @PostMapping("/upload")
    public Result uploadImg(@RequestParam("img") MultipartFile img) {
        return uploadService.uploadImg(img);
    }
}
